package com.atguigu.tingshu.user.client;

import com.atguigu.tingshu.model.album.AlbumInfo;
import com.atguigu.tingshu.model.user.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@FeignClient(name = "service-user",path =  "/client/User/UserInfo"  )
public interface UserClientFeign {

    /**
     * 获取用户数据
     * @param userId
     * @return
     */
    @GetMapping("/getUserInfo/{userId}")
    UserInfo getUserInfo(@PathVariable(value = "userId") Long userId);

    /**
     * 获取用户购买专辑记录
     * @param userId
     * @param albumId
     * @return
     */
    @GetMapping("/BuyAlbum/{userId}/{albumId}")
    UserPaidAlbum BuyAlbum(@PathVariable(value = "userId") Long userId, @PathVariable(value = "albumId") Long albumId);

    /**
     * 购买声音
     * @param userId
     * @param albumId
     * @return
     */
    @GetMapping("/buytrack/{userId}/{albumId}")
    List<Long> buytrack(@PathVariable(value = "userId")Long userId, @PathVariable(value = "albumId") Long albumId);

    /**
     * 获取vip服务
     * @param vipId
     * @return
     */
    @GetMapping("/getVipService/{vipId}")
    VipServiceConfig getVipService(@PathVariable(value = "vipId") Long vipId);

    /**
     * 是否购买过专辑或声音
     * @param albumId
     * @param trackId
     * @return
     */
    @GetMapping("/isOwn/{userId}{albumId}/{trackId}")
    Boolean isOwn (@PathVariable(value = "userId") Long userId,@PathVariable(value = "albumId") Long albumId,@PathVariable(value = "trackId")Long trackId);
}
